﻿@using Resources;
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/knockout-2.1.0.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/knockout.mapping-latest.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.globalize/globalize.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.globalize/cultures/globalize.culture.fr.js")" type="text/javascript"></script>
    
    <script type="text/javascript">
        function Person(json) {
            this.FirstName = ko.observable(json.FirstName);
            this.LastName = ko.observable(json.LastName);

            this.FullName = ko.computed(function () {
            alert(javascriptResources.Message);
                return this.FirstName() + " " + this.LastName();
            }, this);
        };

        var ApplicationViewModel = {};


        function changelanguage(locale) {
             debugger;
            var personJSON = ko.mapping.toJSON(personVM);
            $.ajax({
                cache: false,
                type: "POST",
                url: "\\" + locale + "\\Home\\ChangeLanguage",
                contentType: 'application/json',
                dataType: "json",
                data: personJSON,
                success: function (data) {
                    window.location.href = "\\" + locale + "\\Home\\Knockout";
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    debug;
                    html = '<h1>AJAX Error</h1>' +
            '<p>The AJAX call returned the following error: ' +
                jqXHR.statusText + '.</p>';
                    alert(html);
                }
            });
        };
        var personVM;
        
        
        Globalize.culture( "en" );
var m = Globalize.parseDate( "1/2/2003" ); // Thu Jan 02 2003
Globalize.culture( "fr" );
var n = Globalize.parseDate( "1/2/2003" ); // Sat Feb 01 2003

        //var javascriptResources1 = @Json.Encode(new Resources.JsResources());

        var javascriptResources = @Html.Raw(Json.Encode(new Resources.JsResources()));
        

    </script>
</head>
<body>
    <div class="page">
        <header>
            <div id="title">
                <h1>@Resources.Common.Hello</h1>
            </div>
            <div id="logindisplay">
                @Html.Partial("_LogOnPartial")
            </div>
            <nav>
                <ul id="menu">
                    <li>@Html.ActionLink(Resources.UI.Home, "Index", "Home")</li>
                    <li>@Html.ActionLink(Resources.UI.About, "About", "Home")</li>
                    <li>@Html.ActionLink(Resources.UI.Knockout, "Knockout", "Home")</li>
                </ul>
            </nav>
        </header>
        <section id="main">
            @RenderBody()
        </section>
        <footer>
        </footer>
    </div>
</body>
</html>
